package cn.wolfcode.luowowo.search.template;

import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;

@Document(indexName="luowowo_wenda",type="wenda")
@Getter
@Setter
public class WenDaTemplate implements Serializable {
    public static final String INDEX_NAME = "luowowo_wenda";
    public static final String TYPE_NAME = "wenda";

    @Id
    @Field(store = true, index = true, type = FieldType.Long)
    private Long id; //问答id


    @Field(pattern = "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis", type=FieldType.Date, format = DateFormat.custom)
    private Date createTime;  //创建时间

    @Field(store=true, index = true,type = FieldType.Long)
    private Long destId;  //问答地点

    @Field(index=true,analyzer="ik_smart",store=true,searchAnalyzer="ik_smart",type = FieldType.Text)
    private String destName;

    @Field(index=true,analyzer="ik_smart",store=true,searchAnalyzer="ik_smart",type = FieldType.Text)
    private String title;  //问答标题

    @Field(index=true,analyzer="ik_smart",store=true,searchAnalyzer="ik_smart",type = FieldType.Text)
    private String content; //问答内容


}
